<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
    </head>
    <body>
        <form action="www" method="POST">
            性别: <input type="text" name="gender">
            <input type="submit" value="提交">
        </form>
        <button id="getFits">获取所有大哥</button>
        
    </body>
</html>
<script>
    var getFitsBtn = document.getElementById('getFits');
    getFitsBtn.onclick = function() {
        var myUrl = "http://localhost:8080/fits"
        var xhr = new XMLHttpRequest();
        xhr.onreadystatechange = function() {
            if (this.readyState == 4 && this.status == 200) {
                console.log(this.responseText);
            }
        };
        xhr.open("POST", myUrl);
        xhr.setRequestHeader("content-type","application/x-www-form-urlencoded");

        xhr.send("a=5&b=3");

    };



</script>